# 用于构建 Web 服务镜像
FROM python:3.11-slim

WORKDIR /app

# 只装最精简依赖
COPY requirements.txt .
RUN python -m pip install --upgrade pip setuptools wheel && \
    pip install --no-cache-dir -r requirements.txt

# 只复制源码
COPY . /app

# 创建日志目录并赋予可写权限
RUN mkdir -p /app/logs && chmod 777 /app/logs

ENV PYTHONPATH=/app

EXPOSE 8000

CMD ["python", "main.py"]